package com.lf.lexy.dao;

import java.util.List;

import org.apache.commons.lang3.StringUtils;

import com.jfinal.plugin.activerecord.Db;
import com.jfinal.plugin.activerecord.Page;
import com.lf.lexy.model.GrabUploadInf;
import com.lf.lexy.webutils.CommMethod;

public class GrabUploadInfDao extends GrabUploadInf {
	
	
	public static GrabUploadInfDao me = new GrabUploadInfDao();
	
	
	
	
	public void insert(GrabUploadInf GrabUploadInf){
		GrabUploadInf.save();
	}
	
	
	public void batchAdd(List<GrabUploadInf> GrabUploadInf , int batchSize ){
		int[] batchSave = Db.batchSave(GrabUploadInf, batchSize);
	}
	
	
	
	public Page<GrabUploadInf> getGrabUploadInfPage(int pageNumber , int pageSize , String expandName , String fileType , String reateId){
		String select = "SELECT *";
		String sql = " FROM "+CommMethod.getTbaleName("GrabUploadInf") +" WHERE is_delete='0' ";
		
		if(StringUtils.isNotEmpty(expandName)){
			sql += " AND expand_name = '"+expandName+"'";
		}
		if(StringUtils.isNotEmpty(fileType)){
			sql += " AND file_type = '"+fileType+"'";
		}
		if(StringUtils.isNotEmpty(reateId)){
			sql += " AND reate_id = '"+reateId+"'";
		}
		return dao.paginate(pageNumber, pageSize, select, sql);
	}
	
	
	
	public String geetFileTypeList(){
		return "";
	}
	
	

}
